﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace EpiPoker.Objects
{
    /// <summary>
    /// The Deck of cards
    /// </summary>
    public class Deck
    {
        private List<Card> cards = new List<Card>();

        #region getter/setter

        public List<Card> Cards
        {
            get { return cards; }
            set { cards = value; }
        }

        #endregion

        public Deck()
        {
            for (int i = 0; i <= 3; i++)
            {
                for (int j = 2; j <= 14; j++)
                {
                    Card card = new Card(i, j);
                    cards.Add(card);
                }
            }
        }

        #region functions

        /// <summary>
        /// Convert the card in his string value
        /// </summary>
        public String print()
        {
            String res = "";

            foreach (Card carte in cards)
            {
                res += "Carte : " + (Type)carte.Value
                    + " de " + (Color)carte.Color + "\n";
            }

            return res;
        }

        #endregion
    }
}